package com.loctek.importexport.base;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.squareup.picasso.Picasso;

/**
 * 作者: 司海林
 * 时间: 16/3/9
 * 邮箱: 371184359@qq.com
 * 描述:
 */
public class NetworkImageHolderView implements Holder<Integer> {
    private ImageView imageView;
    private int hight;
    private int width;


    public NetworkImageHolderView(int width, int hight) {
        this.hight = hight;
        this.width = width;
    }


    @Override
    public View createView(Context context) {
        imageView = new ImageView(context);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
    }

    @Override
    public void UpdateUI(Context context, int position, Integer data) {
//        Picasso.with(context).load(data).into(imageView);
        Picasso.with(context).load(data).resize(width, hight).centerCrop().into(imageView);
    }
}
